package com.semidata.trp.algorithm.http;

import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.http.HttpRequest;

import com.semidata.rtd.core.http.server.AbstractDispatchHandler;
import com.semidata.rtd.core.http.server.HttpSession;
import com.semidata.rtd.core.service.ServiceManager;
import com.semidata.rtd.engine.executor.TaskExecutor;
import com.semidata.trp.algorithm.job.AlgorithmJob;
import com.semidata.trp.algorithm.job.AlgorithmJobContext;

public class AlgorithmHttpHandler extends AbstractDispatchHandler{
	public AlgorithmHttpHandler (ChannelHandlerContext ctx, HttpRequest request) {
		super(ctx,request);
	}

	@Override
	public void handle(HttpSession session) {
		// TODO Auto-generated method stub
		System.out.println("bbbbbbbbbbbbbbbbbbbbbbbbbb");
		AlgorithmJobContext context = new AlgorithmJobContext();
		context.setHttpSession(session);
		TaskExecutor executor = ServiceManager.getService(TaskExecutor.class);
		AlgorithmJob job = new AlgorithmJob(executor,context);
		System.out.println("ccccccccccccccccccc");
		job.start();
		System.out.println("ddddddddddddddddddddddddddd");

		
	}
	

}
